package com.trsjh.db.domains;
// Generated 2012-1-13 12:55:11 by Hibernate Tools 3.4.0.CR1



import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Home object for domain model class CustomerAccount.
 * @see com.trsjh.db.domains.CustomerAccount
 * @author Hibernate Tools
 */
public class CustomerAccountHome {

    private static final Log log = LogFactory.getLog(CustomerAccountHome.class);

    @PersistenceContext private EntityManager entityManager;
    
    public void persist(CustomerAccount transientInstance) {
        log.debug("persisting CustomerAccount instance");
        try {
            entityManager.persist(transientInstance);
            log.debug("persist successful");
        }
        catch (RuntimeException re) {
            log.error("persist failed", re);
            throw re;
        }
    }
    
    public void remove(CustomerAccount persistentInstance) {
        log.debug("removing CustomerAccount instance");
        try {
            entityManager.remove(persistentInstance);
            log.debug("remove successful");
        }
        catch (RuntimeException re) {
            log.error("remove failed", re);
            throw re;
        }
    }
    
    public CustomerAccount merge(CustomerAccount detachedInstance) {
        log.debug("merging CustomerAccount instance");
        try {
            CustomerAccount result = entityManager.merge(detachedInstance);
            log.debug("merge successful");
            return result;
        }
        catch (RuntimeException re) {
            log.error("merge failed", re);
            throw re;
        }
    }
    
    public CustomerAccount findById( Integer id) {
        log.debug("getting CustomerAccount instance with id: " + id);
        try {
            CustomerAccount instance = entityManager.find(CustomerAccount.class, id);
            log.debug("get successful");
            return instance;
        }
        catch (RuntimeException re) {
            log.error("get failed", re);
            throw re;
        }
    }
}

